export function getConf (api) {
  const tableProps = {}
  const getHeaderActions = () => {
    return [
      {
        label: '新增',
        onClick: () => {
          alert('新增')
        },
        type: 'primary',
        icon: 'el-icon-plus'
      }
    ]
  }
  const getTableConf = () => {
    return [
      {
        label: '项目名称',
        prop: 'projectName',
        tooltip: true
      },
      {
        label: '操作',
        prop: 'id',
        fixed: 'right',
        width: 200,
        dontVisible: true,
        getContent (row) {
          return (
            <div>
              <el-popconfirm title="确定删除该记录？" onOnConfirm={() => {}}>
                <span class="danger link-text" slot="reference">
                  删除
                </span>
              </el-popconfirm>
            </div>
          )
        }
      }
    ]
  }
  const tableItem = getTableConf()
  return {
    api,
    tableConf: {
      tableProps,
      tableItem
    },
    headerConf: {
      actions: getHeaderActions(),
      title: '项目'
    },
    filterConf: {
      options: [{ label: '项目名称', prop: 'projectName' }, {
        label: '测试',
        prop: 't',
        render (h) {
          return <div>测试:132465</div>
        }
      }],
      actions: [],
      params: {
        projectName: null,
        manager: null,
        workingTime: null
      }
    }
  }
}
